<%@ page language="java" pageEncoding="UTF-8"%>

<span>部门：</span><span id="depart1Span">
	<%@include file="depart1_select.jsp" %>
</span>
<br />
<span>科室：</span><span id="depart2Span">
	<%@include file="depart2_select.jsp" %>
</span>
<br />
<span>岗位：</span><span id="depart3Span">
	<%@include file="post_select.jsp" %>
</span>
<br />
<br />
<input type="button" value="选 择" onclick="selectPost()" />

<script type="text/javascript">
function refreshDepart2(depart1ID) {
	loadPageSection('depart2_select.jsp', 'depart2Span', {depart1ID:depart1ID});
}

function refreshDepart3(depart1ID, depart2ID) {
	loadPageSection('post_select.jsp', 'depart3Span', {depart1ID:depart1ID, depart2ID:depart2ID});
}

function selectPost() {
	var postID = getElementValueByID('depart3ID');
	$.dialog.get('postDialog').close();
	openWaitingDialog('waitingDialog');
	$.ajax({
		type:'post',
		url:'choose_post_process.jsp',
		data:{
			postID: postID
		},
		success:function(data,state,xmlhttp){
			var obj = null;
			try {
				obj = eval('(' + data + ')');
			} catch (e) {
			}
			if (typeof(obj.isSuccess) != 'undefined') {
				if (obj.isSuccess == 'true') {
					loadPageSection('<%=request.getContextPath()%>/register.jsp', 'mainContentDiv');
				} else {
					closeWaitingDialog('waitingDialog');
					$.dialog.alert(obj.error);
				}
			}
		}
	});
}
</script>